//
//  WGQAlbumCollectionViewCell.m
//  meiang_edu
//
//  Created by JUMIWGQ on 2018/10/1.
//  Copyright © 2018 com.meiang.meiang_edu. All rights reserved.
//

#import "WGQAlbumCollectionViewCell.h"
#import "WGQGrowUpLittleModel.h"
#import "WGQFamilyAlbumModel.h"

@interface WGQAlbumCollectionViewCell ()

@property (nonatomic,strong) UIImageView * imageView;

@end

@implementation WGQAlbumCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self addSubViews];
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)addSubViews
{
    self.imageView = [[UIImageView alloc] initWithFrame:self.contentView.bounds];
    [self.contentView addSubview:self.imageView];
}

- (void)setObject:(id)object
{
    if ([object isKindOfClass:[WGQGrowUpLittleModel class]])
    {
        WGQGrowUpLittleModel * model = object;
        DLog(@"%@",[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IMG_OSS,model.ps_id]]);
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IMG_OSS,model.ps_id]]];
    }
    
    if ([object isKindOfClass:[WGQFamilyAlbumModel class]])
    {
        WGQFamilyAlbumModel * model = object;
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IMG_OSS,model.os_id]]];
    }
}

@end
